package com.cskaoyan.shopping.controller;

import com.cskaoyan.mall.commons.result.ResponseData;
import com.cskaoyan.mall.commons.result.ResponseUtil;
import com.cskaoyan.shopping.dto.TestProductDetailDto;
import com.cskaoyan.shopping.service.ITestProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestProductController {

    @Autowired
    ITestProductService productService;

    @GetMapping("/shopping/test")
    public ResponseData getProductDetail(Long productId) {

        TestProductDetailDto productDetail = productService.getProductDetail(productId);

        return new ResponseUtil().setData(productDetail);
    }
}
